set script of this card to "on openCard" & return & "global storedScript" & return & "if field 1 is empty then put storedScript into field 1" & return & "end openCard"
push card
set lockMessages to true
domenu "open stack..."
put the short name of this stack into stackname
if stackname is "Script Extractor" then
domenu delete card
exit exScript
end if
put extracting
set lockScreen to true
set cursor to 4
storeScript
go stack "Script Extractor"
set lockMessages to false
pop card
set the name of this card to stackName
hide msg
end exScript
on storeScript
global storedScript
put " REPORT FROM SCRIPT EXTRACTOR 2.3" & return into storedScript
put ">>>Stack" && quote & short name of this stack && quote && "contains" && number of backgrounds && "backgrounds and" && number of cards && "cards." after storedScript
put return & "______Stack Script______" after storedScript
if the script of this stack is not empty then put return & the script of this stack after storedscript
else put "_______The script of this stack is empty."
repeat with i = 1 to number of backgrounds
go to card 1 of bkgnd i
put return after storedScript
put return & ">>>>>Background" && quote & the short name of this background & quote && "contains" && number of bkgnd buttons && "buttons and" && number of bkgnd fields && "fields." after storedScript
if the script of this background is not empty then put return & "______Bkgnd Script______"& return & the script of this background after storedScript
else put return & "______The script of this background is empty." after storedScript
repeat with j = 1 to number of background buttons
put return & "• The script for bkgnd button " & quote & the short name of background button j & quote after storedScript
if the script of background button j is not empty then put return & the script of background button j after storedScript
else put " is empty." after storedScript
end repeat
repeat with j = 1 to number of background fields
put return & "◊ The script for bkgnd field " & quote & the short name of background field j & quote after storedScript
if the script of background field j is not empty then put return & the script of background field j after storedScript
else put " is empty." after storedScript
end repeat
if the number of backgrounds = 1 then
repeat with m = 1 to the number of cards
go card m
cardExtract
end repeat
else
repeat until number of this bkgnd ≠ i
cardExtract
go next
end repeat
end if
end repeat
put return & "This report contains "& the number of lines in storedScript & " lines." after line 1 of storedScript
end storeScript
on cardExtract
global storedScript
put return after storedScript
put return & "****Card "&& quote & the short name of this card & quote &&"contains" && number of card buttons && "card buttons and" && number of card fields && "card fields."after storedScript
if the script of this card is not empty then put return &"______Card Script_____" & return & the script of this card after storedScript
else put return &"______The script of this card is empty." after storedScript
repeat with k = 1 to the number of card buttons
put return & "• The script of card button" && quote & the short name of card button k & quote after storedScript
if the script of card button k is not empty then put return & the script of card button k & return after storedScript
else put " is empty." after storedScript
end repeat
put return after storedScript
repeat with k = 1 to the number of card fields
put return & "◊ The script of card field" && quote & the short name of card field k & quote after storedScript
if the script of card field k is not empty then put return & the script of card field k & return after storedScript
else put " is empty." after storedScript
end repeat
end cardExtract
on closestack
global saveLevel
if the freeSize of this stack > 1024*2 then domenu compact stack